package com.ourteam.product.requirement.domain;
/**
 * Template Name : DTO数据对象 Template Version : 1 Template Last Modfiy Date : Fri Nov 30 16:49:33 CST
 * 2018 Auto Generate Date : 2018-12-11 15:24:12 Warning ! This file will be overwrite when
 * regenerate !
 */
import java.util.HashMap;
import java.util.Map;
import net.dao.IDataPopulateCallback;
import org.apache.commons.beanutils.BeanMap;
import org.apache.commons.lang.ArrayUtils;

public class ProductVersionRelateBean implements java.io.Serializable {

  private static Map<String, String> mappedDaoFields = new HashMap<String, String>();

  private com.ourteam.product.requirement.dao.ProductVersionRelate productVersionRelate;

  protected BeanMap getBeanMap() {

    return new BeanMap(productVersionRelate);
  }

  static {
    mappedDaoFields.put("id", com.ourteam.product.requirement.dao.IProductVersionRelateDAO.Id);

    mappedDaoFields.put(
        "productDefineId",
        com.ourteam.product.requirement.dao.IProductVersionRelateDAO.ProductDefineId);

    mappedDaoFields.put(
        "productVersionId",
        com.ourteam.product.requirement.dao.IProductVersionRelateDAO.ProductVersionId);

    mappedDaoFields.put(
        "productElementId",
        com.ourteam.product.requirement.dao.IProductVersionRelateDAO.ProductElementId);

    mappedDaoFields.put(
        "productElementType",
        com.ourteam.product.requirement.dao.IProductVersionRelateDAO.ProductElementType);

    mappedDaoFields.put(
        "status", com.ourteam.product.requirement.dao.IProductVersionRelateDAO.Status);

    mappedDaoFields.put(
        "remarks", com.ourteam.product.requirement.dao.IProductVersionRelateDAO.Remarks);
  }

  public static String getMappedDAOField(String aAttrName) {
    return mappedDaoFields.get(aAttrName);
  }

  public ProductVersionRelateBean() {
    super();

    this.productVersionRelate = new com.ourteam.product.requirement.dao.ProductVersionRelate();
  }

  public ProductVersionRelateBean(
      com.ourteam.product.requirement.dao.ProductVersionRelate productVersionRelate) {
    super();

    this.productVersionRelate = productVersionRelate;
  }

  public com.ourteam.product.requirement.dao.ProductVersionRelate convertToProductVersionRelate() {
    return this.productVersionRelate;
  }

  public com.ourteam.product.requirement.dao.ProductVersionRelate convertTo() {
    return this.productVersionRelate;
  }

  /**
   * Get id
   *
   * @return long
   */
  public long getId() {
    return (long) this.productVersionRelate.getId();
  }

  /**
   * Set id
   *
   * @parameter long
   */
  public void setId(long id) {

    this.productVersionRelate.setId(id);
  }

  /**
   * Get productDefineId
   *
   * @return long
   */
  public long getProductDefineId() {
    return (long) this.productVersionRelate.getProductDefineId();
  }

  /**
   * Set productDefineId
   *
   * @parameter long
   */
  public void setProductDefineId(long productDefineId) {

    this.productVersionRelate.setProductDefineId(productDefineId);
  }

  /**
   * Get productVersionId
   *
   * @return long
   */
  public long getProductVersionId() {
    return (long) this.productVersionRelate.getProductVersionId();
  }

  /**
   * Set productVersionId
   *
   * @parameter long
   */
  public void setProductVersionId(long productVersionId) {

    this.productVersionRelate.setProductVersionId(productVersionId);
  }

  /**
   * Get productElementId
   *
   * @return long
   */
  public long getProductElementId() {
    return (long) this.productVersionRelate.getProductElementId();
  }

  /**
   * Set productElementId
   *
   * @parameter long
   */
  public void setProductElementId(long productElementId) {

    this.productVersionRelate.setProductElementId(productElementId);
  }

  /**
   * Get productElementType
   *
   * @return String
   */
  public String getProductElementType() {
    return (String) this.productVersionRelate.getProductElementType();
  }

  /**
   * Set productElementType
   *
   * @parameter String
   */
  public void setProductElementType(String productElementType) {

    this.productVersionRelate.setProductElementType(productElementType);
  }

  /**
   * Get status
   *
   * @return String
   */
  public String getStatus() {
    return (String) this.productVersionRelate.getStatus();
  }

  /**
   * Set status
   *
   * @parameter String
   */
  public void setStatus(String status) {

    this.productVersionRelate.setStatus(status);
  }

  /**
   * Get remarks
   *
   * @return String
   */
  public String getRemarks() {
    return (String) this.productVersionRelate.getRemarks();
  }

  /**
   * Set remarks
   *
   * @parameter String
   */
  public void setRemarks(String remarks) {

    this.productVersionRelate.setRemarks(remarks);
  }

  public int hashCode() {
    return org.apache.commons.lang.builder.HashCodeBuilder.reflectionHashCode(this);
  }

  public boolean equals(Object obj) {
    if (obj == null) {
      return false;
    } // end if

    if ((obj instanceof ProductVersionRelateBean) == false) {
      return false;
    } // end if

    ProductVersionRelateBean other = (ProductVersionRelateBean) obj;

    boolean isEqual = false;

    com.ourteam.product.requirement.dao.ProductVersionRelate tempProductVersionRelate =
        other.convertToProductVersionRelate();

    if (tempProductVersionRelate == null || this.productVersionRelate == null) {
      isEqual = false;
    } else if (tempProductVersionRelate == this.productVersionRelate
        || tempProductVersionRelate.equals(this.productVersionRelate)) {
      isEqual = true;
    } else {
      isEqual = false;
    }

    return isEqual;
  }

  public static ProductVersionRelateBean[] toArray(
      com.ourteam.product.requirement.dao.ProductVersionRelate[] aProductVersionRelates) {

    return toArray(aProductVersionRelates, null);
  }

  public static ProductVersionRelateBean[] toArray(
      com.ourteam.product.requirement.dao.ProductVersionRelate[] aProductVersionRelates,
      IDataPopulateCallback aCallBack) {

    if (ArrayUtils.isEmpty(aProductVersionRelates)) {
      return new ProductVersionRelateBean[0];
    }

    int length = aProductVersionRelates.length;

    ProductVersionRelateBean[] beans = new ProductVersionRelateBean[length];

    for (int i = 0; i < length; i++) {
      beans[i] = new ProductVersionRelateBean(aProductVersionRelates[i]);
      if (aCallBack != null) {
        aCallBack.populate(beans[i], new Object[] {aProductVersionRelates[i]});
      }
    }

    return beans;
  }
}
